﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

/// <summary>
/// Summary description for ControlHandler
/// </summary>
public class ControlHandler
{
	public ControlHandler()
	{
		
	}
     // thực hiện load tất cả các Control to List bao gồm TextBox và Radiobutton
    public void GetControlList<T>(ControlCollection controlCollection, List<T> resultCollection)
    where T : Control
    {
        foreach (Control control in controlCollection)
        {
            if (control is T) 
                resultCollection.Add((T)control);

            if (control.HasControls())
                GetControlList(control.Controls, resultCollection);
        }
    }
}